﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Tanmia.Core;
using FluentNHibernate.Mapping;

namespace Tanmia.NHibernate.Mapping
{
    public class ItemMap : ClassMap<Item>
    {
        public ItemMap()
        {
            Table("Item");

            Id(x => x.ItemID).Not.Nullable().GeneratedBy.Identity();

            Map(x => x.Name).Length(128).Not.Nullable();
            Map(x => x.Image);
            Map(x => x.CreateDate).Not.Nullable().Not.Update();
            Map(x => x.Note).Length(2048).Nullable();

            References(x => x.Category, "ItemCategoryID").Not.Nullable();
        }
    }
}
